<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: Low Power Callbacks</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__scb__spi__low__power__functions.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Low Power Callbacks<div class="ingroups"><a class="el" href="group__group__scb.html">SCB          (Serial Communication Block)</a> &raquo; <a class="el" href="group__group__scb__spi.html">SPI (SCB)</a> &raquo; <a class="el" href="group__group__scb__spi__functions.html">Functions</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gabf413c42a9ba8a20c38f2491ae2e36c0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__syspm__data__enumerates.html#ga601b1cb722cb091133caf33d8ab235ca">cy_en_syspm_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__scb__spi__low__power__functions.html#gabf413c42a9ba8a20c38f2491ae2e36c0">Cy_SCB_SPI_DeepSleepCallback</a> (<a class="el" href="structcy__stc__syspm__callback__params__t.html">cy_stc_syspm_callback_params_t</a> *callbackParams, <a class="el" href="group__group__syspm__data__enumerates.html#gae06cd8869fe61d709ad6145ca9f3cd63">cy_en_syspm_callback_mode_t</a> <a class="el" href="group__group__ipc__bt__data__structures.html#ga37e90f5e3bd99fac2021fb3a326607d4">mode</a>)</td></tr>
<tr class="memdesc:gabf413c42a9ba8a20c38f2491ae2e36c0"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function handles the transition of the SCB SPI into and out of Deep Sleep mode.  <a href="#gabf413c42a9ba8a20c38f2491ae2e36c0">More...</a><br /></td></tr>
<tr class="separator:gabf413c42a9ba8a20c38f2491ae2e36c0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1bf16639bec6ac8209621227bd5ac0e3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__syspm__data__enumerates.html#ga601b1cb722cb091133caf33d8ab235ca">cy_en_syspm_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__scb__spi__low__power__functions.html#ga1bf16639bec6ac8209621227bd5ac0e3">Cy_SCB_SPI_HibernateCallback</a> (<a class="el" href="structcy__stc__syspm__callback__params__t.html">cy_stc_syspm_callback_params_t</a> *callbackParams, <a class="el" href="group__group__syspm__data__enumerates.html#gae06cd8869fe61d709ad6145ca9f3cd63">cy_en_syspm_callback_mode_t</a> <a class="el" href="group__group__ipc__bt__data__structures.html#ga37e90f5e3bd99fac2021fb3a326607d4">mode</a>)</td></tr>
<tr class="memdesc:ga1bf16639bec6ac8209621227bd5ac0e3"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function handles the transition of the SCB SPI into Hibernate mode.  <a href="#ga1bf16639bec6ac8209621227bd5ac0e3">More...</a><br /></td></tr>
<tr class="separator:ga1bf16639bec6ac8209621227bd5ac0e3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="gabf413c42a9ba8a20c38f2491ae2e36c0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabf413c42a9ba8a20c38f2491ae2e36c0">&#9670;&nbsp;</a></span>Cy_SCB_SPI_DeepSleepCallback()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__syspm__data__enumerates.html#ga601b1cb722cb091133caf33d8ab235ca">cy_en_syspm_status_t</a> Cy_SCB_SPI_DeepSleepCallback </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcy__stc__syspm__callback__params__t.html">cy_stc_syspm_callback_params_t</a> *&#160;</td>
          <td class="paramname"><em>callbackParams</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__syspm__data__enumerates.html#gae06cd8869fe61d709ad6145ca9f3cd63">cy_en_syspm_callback_mode_t</a>&#160;</td>
          <td class="paramname"><em>mode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function handles the transition of the SCB SPI into and out of Deep Sleep mode. </p>
<p>It prevents the device from entering Deep Sleep mode if the SPI slave or master is actively communicating, or there is any data in the TX or RX FIFOs. The following behavior of the SPI SCB depends on whether the SCB block is wakeup-capable or not:</p><ul>
<li><b>Wakeup-capable</b>: any transfer intended to the slave wakes up the device from Deep Sleep mode. The slave responds with 0xFF to the transfer and incoming data is ignored. If the transfer occurs before the device enters Deep Sleep mode, the device will not enter Deep Sleep mode and incoming data is stored in the RX FIFO. The SCB clock is disabled before entering Deep Sleep and enabled after the device exits Deep Sleep mode. The SCB clock disabling may lead to corrupted data in the RX FIFO. Clear the RX FIFO after this callback is executed. Note that for proper SPI operation after Deep Sleep the source of hf_clk[0] must be stable, this includes the FLL/PLL. The SysClk callback ensures that hf_clk[0] gets stable and it must be called before <a class="el" href="group__group__scb__spi__low__power__functions.html#gabf413c42a9ba8a20c38f2491ae2e36c0">Cy_SCB_SPI_DeepSleepCallback</a>. Only the SPI slave can be configured to be a wakeup source from Deep Sleep mode.</li>
<li><b>Not wakeup-capable</b>: the SPI is disabled. It is enabled when the device fails to enter Deep Sleep mode or it is awakened from Deep Sleep mode. While the SPI is disabled, it stops driving the outputs and ignores the inputs. Any incoming data is ignored. Refer to section <a class="el" href="group__group__scb__spi.html#group_scb_spi_lp">Low Power Support</a> for more information about SPI pins when SCB disabled.</li>
</ul>
<p>This function must be called during execution of <a class="el" href="group__group__syspm__functions__power.html#ga5150c28fe4d2626720c1fbf74b3111ca">Cy_SysPm_CpuEnterDeepSleep</a>. To do it, register this function as a callback before calling <a class="el" href="group__group__syspm__functions__power.html#ga5150c28fe4d2626720c1fbf74b3111ca">Cy_SysPm_CpuEnterDeepSleep</a> : specify <a class="el" href="group__group__syspm__data__enumerates.html#gga8c2960c0164ead1cfa86e7d6846b6ff0abc51d74deff0ceea4304b01b2d57bd9d">CY_SYSPM_DEEPSLEEP</a> as the callback type and call <a class="el" href="group__group__syspm__functions__callback.html#ga0d58b00c8dc764a6371590f70e2f73c7">Cy_SysPm_RegisterCallback</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">callbackParams</td><td>The pointer to the callback parameters structure <a class="el" href="structcy__stc__syspm__callback__params__t.html">cy_stc_syspm_callback_params_t</a>.</td></tr>
    <tr><td class="paramname">mode</td><td>Callback mode, see <a class="el" href="group__group__syspm__data__enumerates.html#gae06cd8869fe61d709ad6145ca9f3cd63">cy_en_syspm_callback_mode_t</a></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__syspm__data__enumerates.html#ga601b1cb722cb091133caf33d8ab235ca">cy_en_syspm_status_t</a></dd></dl>
<dl class="section note"><dt>Note</dt><dd>Only applicable for <b>rev-08 of the CY8CKIT-062-BLE</b>. For proper operation, when the SPI slave is configured to be a wakeup source from Deep Sleep mode, this function must be copied and modified by the user. The SPI clock disable code must be inserted in the <a class="el" href="group__group__syspm__data__enumerates.html#ggae06cd8869fe61d709ad6145ca9f3cd63a7d302375276b3b5f250a8208c999b558">CY_SYSPM_BEFORE_TRANSITION</a> and clock enable code in the <a class="el" href="group__group__syspm__data__enumerates.html#ggae06cd8869fe61d709ad6145ca9f3cd63aafd1db1f7f86ac7bbd18d59b78af5693">CY_SYSPM_AFTER_TRANSITION</a> mode processing. </dd></dl>

</div>
</div>
<a id="ga1bf16639bec6ac8209621227bd5ac0e3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1bf16639bec6ac8209621227bd5ac0e3">&#9670;&nbsp;</a></span>Cy_SCB_SPI_HibernateCallback()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__syspm__data__enumerates.html#ga601b1cb722cb091133caf33d8ab235ca">cy_en_syspm_status_t</a> Cy_SCB_SPI_HibernateCallback </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcy__stc__syspm__callback__params__t.html">cy_stc_syspm_callback_params_t</a> *&#160;</td>
          <td class="paramname"><em>callbackParams</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__syspm__data__enumerates.html#gae06cd8869fe61d709ad6145ca9f3cd63">cy_en_syspm_callback_mode_t</a>&#160;</td>
          <td class="paramname"><em>mode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function handles the transition of the SCB SPI into Hibernate mode. </p>
<p>It prevents the device from entering Hibernate mode if the SPI slave or master is actively communicating, or there is any data in the TX or RX FIFOs. If the SPI is ready to enter Hibernate mode, it is disabled. If the device failed to enter Hibernate mode, the SPI is re-enabled. While the SPI is disabled, it stops driving the outputs and ignores the inputs. Any incoming data is ignored. Refer to section <a class="el" href="group__group__scb__spi.html#group_scb_spi_lp">Low Power Support</a> for more information about SPI pins when SCB disabled.</p>
<p>This function must be called during execution of <a class="el" href="group__group__syspm__functions__power.html#gae97647a28c370674ba57d451d21d1c51">Cy_SysPm_SystemEnterHibernate</a>. To do it, register this function as a callback before calling <a class="el" href="group__group__syspm__functions__power.html#gae97647a28c370674ba57d451d21d1c51">Cy_SysPm_SystemEnterHibernate</a> : specify <a class="el" href="group__group__syspm__data__enumerates.html#gga8c2960c0164ead1cfa86e7d6846b6ff0a613e2f83e3ab88e3569cf34ff0fa5912">CY_SYSPM_HIBERNATE</a> as the callback type and call <a class="el" href="group__group__syspm__functions__callback.html#ga0d58b00c8dc764a6371590f70e2f73c7">Cy_SysPm_RegisterCallback</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">callbackParams</td><td>The pointer to the callback parameters structure <a class="el" href="structcy__stc__syspm__callback__params__t.html">cy_stc_syspm_callback_params_t</a>.</td></tr>
    <tr><td class="paramname">mode</td><td>Callback mode, see <a class="el" href="group__group__syspm__data__enumerates.html#gae06cd8869fe61d709ad6145ca9f3cd63">cy_en_syspm_callback_mode_t</a></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__group__syspm__data__enumerates.html#ga601b1cb722cb091133caf33d8ab235ca">cy_en_syspm_status_t</a> </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
